#include "StdAfx.h"
#include "alpha_rotate.h"


alpha_rotate::alpha_rotate(void)
{
}


alpha_rotate::~alpha_rotate(void)
{
}

void alpha_rotate::rotate(phase_space_dist dist)
{
	phase_space_point temp;
	const double sinalpha = sin(angle);
	const double cosalpha = cos(angle);

	for(int i=0;i<dist.size;i++)
	{
		temp.x = dist.dataset[i].x;
		temp.z = dist.dataset[i].z - z0;
		temp.px = dist.dataset[i].px;
		temp.pz = dist.dataset[i].pz;

		dist.dataset[i].z = cosalpha * temp.z + sinalpha * temp.x;
		dist.dataset[i].x = -sinalpha * temp.z + cosalpha * temp.x;

		dist.dataset[i].pz = cosalpha * temp.pz + sinalpha * temp.px;
		dist.dataset[i].px = cosalpha * temp.pz + sinalpha * temp.px;
	}

}

void alpha_rotate::rotate(trace_space_dist dist)
{
	trace_space_point temp;
	const double sinalpha = sin(angle);
	const double cosalpha = cos(angle);

	for(int i=0;i<dist.size;i++)
	{
	}
}